#
# max sum of the subarray
# @param arr int整型一维数组 the array
# @return int整型
#
class Solution:
    def maxsumofSubarray(self , arr ):
        # write code here
        sum = 0
        maxSum = 0
        for i in arr:
            sum = sum + i
            if sum >0:
                maxSum = max(maxSum,sum)
            else:
                sum = 0
        return maxSum